Inside Macintosh: QuickTime

Previous | Chapter Top | Chapter Contents | Next

Sound Media Handler Functions

Sound media handlers are responsible for interpreting and manipulating sound data. These media handlers allow you to call them directly to work with some audio settings. This section describes the functions supported by sound media handlers.

Sound media handlers maintain balance information for their audio data. You can use the SetSoundMediaBalance and GetSoundMediaBalance functions to work with a handler's balance setting.

Sample descriptions for sound media are stored in sound description structures. See "The Sound Description Structure" for a discussion of the format and content of the sound description structure.

SetSoundMediaBalance

The SetSoundMediaBalance function sets the balance of a sound media.

pascal HandlerError SetSoundMediaBalance (MediaHandler mh,
                                         short balance);
mH
Contains a reference to a media handler. You obtain this reference from the GetMediaHandler function, which is described on GetMediaHandler .
balance
Specifies the balance setting of the media handler as a 16-bit, fixed-point value. The high-order 8 bits contain the integer part of the value; the low-order 8 bits contain the fractional part. Valid balance values range from -1.0 to 1.0. Negative values emphasize the left sound channel, and positive values emphasize the right sound channel; a value of 0 specifies neutral balance.

ERROR CODES

Component Manager errors

GetSoundMediaBalance

The GetSoundMediaBalance function returns the balance of a sound media.

pascal HandlerError GetSoundMediaBalance (MediaHandler mh,
                                         short *balance);
mH
Contains a reference to a media handler. You obtain this reference from the GetMediaHandler function, which is described on GetMediaHandler .
balance
Contains a pointer to an integer. The Movie Toolbox returns the current balance setting of the media handler as a 16-bit, fixed-point value. The high-order 8 bits contain the integer part of the value; the low-order 8 bits contain the fractional part. Valid balance values range from -1.0 to 1.0. Negative values emphasize the left sound channel, and positive values emphasize the right sound channel; a value of 0 specifies neutral balance.

ERROR CODES

Component Manager errors


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next